<?php
namespace app\shop\validate\company;
use think\Validate;
class Staff extends Validate
{
    protected $rule = [
        'user_id' => 'require',
        'department_id' => 'require',
        'real_name' => 'require',
        //'job_id' => 'require',
        'join_time' => 'require',
        'type' => 'require',
        'file_type' => 'require',
        'file_path' => 'require',
        'confirm' => 'require'
    ];
    protected $message = [
        'user_id.require' => '请选择用户',
        'department_id.require' => '请选择部门',
        'real_name.require' => '请输入员工姓名',
        //'job_id.require' => '请输入员工工号',
        'join_time.require' => '请选择入职时间',
        'type.require' => '请选择职位',
        'file_type.require' => '请选择文件类型',
        'file_path.require' => '请选择文件',
        'confirm.require' => '请上传离职确认文件'
    ];
    protected $scene = [
        'save' => ['user_id', 'real_name', 'job_id', 'join_time', 'department_id'],
        'info' => ['user_id'],
        'set' => ['user_id', 'department_id', 'type'],
        'saveFile' => ['user_id', 'file_type', 'file_path'],
        'leave' => ['user_id', 'confirm']
    ];
}